﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spring.Context;
using Spring.Context.Support;

namespace SpringPlaceHolder {
	class Program {
		static void Main(string[] args) {
			Console.Out.WriteLine("Starting Placeholder example with Spring.NET");

			// First thing to do is get the Spring Context
			IApplicationContext ctx = ContextRegistry.GetContext();

			MockDatabaseConnection conn = (MockDatabaseConnection)ctx.GetObject("databaseConnection");

			Console.Out.WriteLine("HostName: {0}", conn.hostname);
			Console.Out.WriteLine("Database: {0}", conn.database);
			Console.Out.WriteLine("Username: {0}", conn.username);
			Console.Out.WriteLine("Password: {0}", conn.password);
			Console.In.ReadLine();
		}
	}
}
